package com.sumainfor.pc.market.controller.tenant;

import com.sumainfor.common.util.FieldCheckUtil;
import com.sumainfor.common.util.JsonResult;
import com.sumainfor.pc.market.service.tenant.impl.PayBillService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * 功能描述:
 * 账单相关
 * @Auther: zhlu
 * @Date: 2019/4/28 15:59
 * @Description:
 */
@RestController
@RequestMapping("/tenant/key/paybill")
public class PayBillController {

    @Autowired
    PayBillService PayBillService;

    /**
     * 功能描述:
     * 根据账单资料房源资料获取房源信息
     * @Author zhlu
     * @Description //TODO
     * @Date 2019/4/28 16:05
     */
    @GetMapping("/getTrenantBillHousing")
    public JsonResult getTrenantBillHousing(@RequestParam Map<String,Object> params){
        JsonResult result=new JsonResult();
        if(!FieldCheckUtil.isMapFieldNotNull(params,new String[]{"BiId"})){
            result.putFailed("BiId不能为空！");
            return  result;
        }
        return result.put(PayBillService.getTrenantBillHousing(params));
    }

    /**
     * 根据合同编号获取合同详情
     * @param params
     * @return
     */
    @GetMapping("/getPaIdChaId")
    public JsonResult getPaIdChaId(@RequestParam Map<String,Object> params){
        return PayBillService.getPaIdChaId(params);
    }

}
